import { Column, Entity } from 'typeorm';
import { BoolEnum } from '../enum/common.enum'
import { CommonEntity } from './common.entity'

@Entity('tt_articles')
export class BlogEntity extends CommonEntity{

    @Column({ length: 50, nullable:false})
    title: string;

    @Column({type:'longtext', nullable:false})
    content: string;
    
    @Column({
        type:'enum',
        enum:BoolEnum, 
        nullable:false,
        comment:'是否原创'
    })
    isOrigin: string;
    
    @Column({type:'varchar', nullable:false,})
    userId: string;

    @Column({type:'int', nullable:true,})
    likeCount: number;

    @Column({type:'int', nullable:true,})
    viewCount: number;

    @Column({type:'varchar', nullable:false,})
    coverPicUrl: string;
}